<%--
  Created by IntelliJ IDEA.
  User: cjt
  Date: 2020/12/10
  Time: 18:20
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>编辑</title>
    <link rel="stylesheet" href="/css/main.css">
    <link rel="stylesheet" href="/css/font-awesome/css/font-awesome.css">
</head>
<body>
<div class="box">
    <h3>添加用户信息</h3>
    <form action="/user/edit" method="post">
        <table class="form-table">
            <tr>
                <td>登录号码</td>
                <td colspan="3" class="control">
                    <input type="text" name="username" placeholder="登录号码" value="${user.username}">
                </td>
            </tr>
            <tr>
                <td>真实姓名</td>
                <td colspan="3" class="control">
                    <input type="text" name="realname" placeholder="真实姓名" value="${user.realname}">
                </td>
            </tr>
            <tr>
                <td>性别</td>
                <td colspan="3" class="control">
                    <select name="sex">
                        <option value="0" ${user.sex == "0" ? "selected" : ""}>男</option>
                        <option value="1" ${user.sex == "1" ? "selected" : ""} >女</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td>身份</td>
                <td colspan="3" class="control">
                    <select name="role_id">
                        <c:forEach items="${roles}" var="role">
                            <option value="${role.ro_id}" ${role.ro_id == user.role_id ? "selected" : ""}>${role.ro_name}</option>
                        </c:forEach>
                    </select>
                </td>
            </tr>
            <tr>
                <td>账号状态</td>
                <td colspan="3" class="control">
                    <select name="state">
                        <option value="0" ${user.state == "0" ? "selected" : ""}>启用</option>
                        <option value="1" ${user.state == "1" ? "selected" : ""} >禁用</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td>设置新密码</td>
                <td colspan="3" class="control">
                    <input type="text" name="pwd" placeholder="密码" value="">
                </td>
            </tr>
        </table>
        <div class="buttons">
            <input class="btn btn-primary va-bottom" type="submit" value="保存">&nbsp;&nbsp;
            <a class="btn btn-default" href="javascript:history.go(-1)">返回</a>
        </div>
    </form>
</div>

</body>
</html>
